<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>

<body>

    <dvi id="app">
        <h2>简单计算器:实现简单的加法计算</h2>

        <label>数值A</label>
        <input v-model.number="a" /><br />

        <label>数值B</label>
        <input v-model.number="b" /><br />

        <button @click="conputer">计算</button>
        
        <div>计算结果：
            <div v-cloak>{{result}}</div>
        </div>

    </dvi>


    <script src="../../js/vue.js"></script>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                result: "0",
                a: "",
                b: ""
            },
            methods: {
                conputer() {
                    this.result = this.a + this.b;
                }
            }
        })
    </script>
</body>

</html>